package process_demo.timer.impl2;

/**
 * @author haomin
 * @date 2022/05/03 19:03
 **/
public abstract class MyTimerTask implements Comparable<MyTimerTask> {
    long runAt;

    abstract public void run();

    @Override
    public int compareTo(MyTimerTask o) {
        if (runAt < o.runAt) {
            return -1;
        } else if (runAt > o.runAt) {
            return 1;
        } else {
            return 0;
        }
    }
}